#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QMenu>
#include "xyphonecontrol.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    void init(void);
    void initBindSlot(void);
    void initConf(void);
private slots:
    void slot_close(void);
    void slot_sipRegister(void);
    void slot_sipCall(void);
    void slot_sipHangup(void);
private:
    Ui::Widget *ui;
    XyPhoneControl* m_pControl;
    QPoint m_last;
    QMenu m_menu;
    QVariantMap m_mapConf;

    // QWidget interface
protected:
    virtual void mousePressEvent(QMouseEvent *event) override;
    virtual void mouseReleaseEvent(QMouseEvent *event) override;
    virtual void mouseMoveEvent(QMouseEvent *event) override;
};
#endif // WIDGET_H
